﻿using AuthenticationDemo.Models.Enum;

namespace AuthenticationDemo.Models.Base
{
    public class ResponseBase<T>
    {
        public ResponseCode Code { get; set; }
        public bool Success { get; set; }
        public string Message { get; set; }
        public T Data { get; set; }
        public ResponseBase(ResponseCode code = ResponseCode.OK, bool success = true, string message = "SUCCESS", T data = default)
        {
            Code = code;
            if (Code == ResponseCode.OK)
                Success = true;
            else
                Success = success;
            Message = message;
            Data = data;
        }
    }
}
